home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 44 / Amiga Format CD44 (1999-08-26)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-10].iso / -in_the_mag- / basics / amos / ap_gui.lha / master.AMOS / master.amosSourceCode < prev   
AMOS Source Code  |  1996-05-27  |  2KB  |  108 lines

  1. 'Here's the source to the Master GUI program. It's far from perfect, but 
  2. 'I threw it together in a day. There is a bug somewhere so you have to select
  3. 'an option two times for it to work :( 
  4. 'ahapp@top.monad.net 
  5. Amos To Back 
  6. Global GAD,M,A,A$,SHIELD,AA,ANSWER
  7. 'Load "WORK:AMOS_PRO/cool.abk",20
  8.  Extension_24_02DC 
  9.  Extension_24_0018 1,1,20 : Extension_24_02C6 
  10. 'startup:
  11. If Arexx Exist("AREXX")=0
  12.    Exec "RexxMast"
  13.    If Arexx Exist("AREXX")=0
  14.       Print "AREXX not installed on this machine!"
  15.       Bell : Stop 
  16.    End If 
  17. End If 
  18. Arexx Open "AMOSTCP"
  19. Every 1 Proc _DOGUI
  20. _WAIT_MESSAGE
  21.  
  22. Procedure _WAIT_MESSAGE
  23.    Do 
  24.       If Arexx
  25.          Print "AREXX message: ";Arexx$(0)
  26.          If ANSWER=1
  27.             Trap Arexx Answer 0,Str$(AA)
  28.          End If 
  29.       End If 
  30.    Loop 
  31. End Proc
  32. Trap Arexx Answer 0,"Bye bye!"
  33. Arexx Close 
  34.  
  35. Procedure CHECK_MENU
  36.    M= Extension_24_0060(3)
  37.    'M1=Gui Menu(4)
  38.    If M=1
  39.       AA=1
  40.       ANSWER=1
  41.       Bell 15
  42.       Trap Arexx Answer 0,Str$(AA)
  43.    End If 
  44.    If M=2
  45.       AA=2
  46.       ANSWER=1
  47.       Bell 15
  48.       Trap Arexx Answer 0,Str$(AA)
  49.       'beep
  50.    End If 
  51.    If M=3
  52.       AA=3
  53.       ANSWER=1
  54.       Bell 15
  55.       Trap Arexx Answer 0,Str$(AA)
  56.       'crash 
  57.    End If 
  58.    If M=4
  59.       AA=4
  60.       ANSWER=1
  61.       Bell 15
  62.       Trap Arexx Answer 0,Str$(AA)
  63.       'led flash 
  64.    End If 
  65.    If M=5
  66.       SHIELD=1
  67.       Bell 15
  68.       Trap Arexx Answer 0,Str$(AA)
  69.       'shield
  70.    End If 
  71.    ANSWER=0
  72. End Proc
  73.  
  74. Procedure SHUTDOWN
  75.    RESULT= Extension_24_0032(1)
  76.    System 
  77. End Proc
  78.  
  79. Procedure CRASH
  80.    If SHIELD=0
  81.       Say "Hasta la vista, baby."
  82.       Do 
  83.          Inc HEHE
  84.          Poke HEHE,Rnd(255)
  85.       Loop 
  86.    End If 
  87.    If SHIELD=1
  88.       Say "You are safe!"
  89.    End If 
  90. End Proc
  91. Procedure _DOGUI
  92.    _VALUE= Extension_24_0042 
  93.    If _VALUE=0
  94.       Led On 
  95.    End If 
  96.    If _VALUE=1
  97.       Led Off 
  98.    End If 
  99.    GAD= Extension_24_0024 
  100.    If GAD=-1
  101.       'pressed close button
  102.       SHUTDOWN
  103.    End If 
  104.    If GAD=-2
  105.       CHECK_MENU
  106.    End If 
  107.    Every On 
  108. End Proc